/**
 * 
 */

package com.shy.portal.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.shy.base.service.impl.BaseServiceImpl;
import com.shy.portal.dao.RoleMenuDao;
import com.shy.portal.entity.RoleMenu;
import com.shy.portal.service.RoleMenuService;

/**
 * <p>
 * Title: RoleMenuServiceImpl
 * </p>
 * <p>
 * Description:角色菜单控制service层实现
 * </p>
 * <p>
 * Company:ipebg
 * </p>
 * 
 * @author H2013788
 */
@Transactional
@Service("roleMenuService")
public class RoleMenuServiceImpl extends BaseServiceImpl<RoleMenu> implements RoleMenuService {

    /**
     * log
     */
	private Logger logger = LogManager.getLogger(this.getClass());
	

    /**
     * 角色菜单dao
     */
    @Resource
    private RoleMenuDao roleMenuDao;

    /**
     * 
     * @param roleMenuDao 角色菜单dao
     * @author H2201965
     * @date 2018/2/6下午3:43:30
     */
    @Resource
    protected void setBaseDao(RoleMenuDao roleMenuDao) {
        this.baseDao = roleMenuDao;
    }

    @Override
    public boolean batchSaveRoleMenu(List<RoleMenu> list, Integer roleId) throws Exception {
        try {
            return roleMenuDao.batchSaveRoleMenu(list, roleId);
        } catch (Exception e) {
            e.printStackTrace();
            logger.error(" batch save rolemenu error " + e);
            throw e;
        }
    }
}
